package com.lt.springbootcrm.repository;

import com.lt.springbootcrm.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface UserRepository extends JpaRepository<User,Long> {

    List<User> findByUsrNameLike(String usrName);

    @Query("select u from User u where u.usrRoleId=?1")
    Page<User> findPageByUsrRoleId(Long roleId, Pageable pageable);
}
